<script language='JavaScript' type='text/javascript'>
function showDiv(divId)
{
	if (document.all)
	  document.all[divId].style.display = 'block';
	else if (document.layers)
	  document.layers[divId].display = 'block';
	 else
	 {
	   document.getElementById(divId).style.display='block';
	 }

}
</script>

<div id="maincontent">
<%= render :partial => "shared_common_files/data_area_help_bar" %>
<%if(@test_connection!=nil)%>
<br/>
<div class='message-justmsg'> 
	<font color="black"><%=@test_connection.connection_message%> 
	<br/>
	<a href="javascript:showDiv('login_div')">Show connection details</a>
  <div  id="login_div" style="display: none;">
	Session Id: <%=@test_connection.response_object.result.sessionId[0,6]%>.... 
	<br/>
	Server URL: <%=@test_connection.response_object.result.serverUrl%> 
	<br/>
	User Id: <%=@test_connection.response_object.result.userId%> 
	<br/>
  </div>

  </font>
</div>
<%end%>

<h2>Mashup Create/Update</h2>					
		
		
					
<%= start_form_tag({:action => 'mashup'},{:class => 'appform'}, {:method=> 'post'}) %>

	


	<div class="req"><b>*</b>Required Information </div>

	<fieldset>
		<h3> Enter web service details </h3>
		
		<%=error_messages_for("mashup_node")%>

		<!-- label for="name"><b><span class="req">*</span>Mashup Name :</b -->
			<input class="f-name" type="hidden" name="mashup_node[name]" required="true" size="30" value="<%=params['mashup_node[name]']%>"/>
		<!-- /label -->
		
		<label for="name"><b><span class="req">*</span>User Name :</b>
			<input class="f-name" type="text" name="mashup_node[username]" required="true" size="30" value="<%=params['mashup_node[username]']%>"/><br />
		</label>
		
		<label for="name"><b><span class="req">*</span>Password :</b>
			<input class="f-comments" type="password" name="mashup_node[password]" size="30" value="<%=params['mashup_node[password]']%>"/><br />
		</label>
		
		<label for="name"><b><span class="req">*</span>WSDL URL :</b>
			<input class="f-name" type="text" name="mashup_node[wsdl_url]" required="true" size="30"  value="#{RAILS_ROOT}/app/apis/integration/salesforce/salesforce-enterprise.wsdl"/><br />
		</label>
	<!--
		<div class="f-submit-wrap">
		  	<%= image_submit_tag "/themes/odotclassic/images/btn_login.gif", :border => 0 %>
        	<%= link_to image_tag('/themes/odotclassic/images/btn_cancel.gif'),  :action => ''%>
		</div> 
    -->
     <div class="f-submit-wrap">
		<input type="submit" name="crnewform" value="Save" />
		<%= link_if_authorized submit_tag('Test Connection'), {:action => 'mashup', "op"=>"login"}  %>
		<%= link_if_authorized submit_tag('Browse Objects'), {:action => 'browse_objects'}  %>
	  </div>
	  		
		</fieldset>
<%= end_form_tag %>
 	
</div>
